package com.yunhe.mapper;

import com.yunhe.javabean.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ProductMapper {

    public List<Product> selectAll(String productName);

    @Select("select * from product where id =#{id}")
    public Product selectById(int id);

    @Update("update product set productNum=#{productNum},productName=#{productName},cityName=#{cityName},departureTime=#{departureTime},productPrice=#{productPrice},productDesc=#{productDesc},productStatus=#{productStatus} where id=#{id}")
    public int updateById(Product product);

    @Insert("insert into product(productNum, productName, cityName, departureTime, productPrice, productDesc, productStatus)values(#{productNum},#{productName},#{cityName},#{departureTime},#{productPrice},#{productDesc},#{productStatus})")
    public int insert(Product product);

    @Delete("delete from product where id=#{id}")
    public int delete(int id);

    public int deleteByList(List<Integer> ids);




}
